< previous page page_431 next page >

Page 431
8694cbadb9b1ef7075903f6f95fc1db2.gif
12:
13:     PostMessage Me.hwnd, WM_USER, 0&, 0&
14: '------------------------------------------------------------
15: End Sub

In this routine, you can see that you can test to see which button was clicked, allowing you to perform different actions based on the mouse button clicked. Also, because of the quirks with using the SysTray control, you need to use the two API calls as shown to set the correct Windows handles.
Add the code in Listing 15.7 to the Address Book application. Now, start the application and use each mouse button to click the tray icon to see the different menus that pop up (see Figure 15.6).
12181-0431a.gif
Figure 15.6.
Displaying menus by clicking the system tray icon.
Introducing the New Date Controls
Almost every windows application requires the user to enter dates in one format or another. Originally, most programmers used text boxes and then coded all of the edit and input routines required to enable the user to enter dates properly. Then, the Masked Edit control was introduced allowing the programmer to specify an input length and format for the data. Along the way, many Calendar custom controls were created to display a visual calendar to the user, as shown in Figure 15.7.

 
< previous page page_431 next page >

If you like this book, buy it!